import fetch from '../utils/fetch'
import config from '../utils/config'
import { querystring } from 'vux'

var MyInviteBidService = {
  getMyInviteBid (providerGUID) {
    var data = {
      action: 'GetMyInviteBid',
      ProviderGUID: providerGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  getInviteBid (inviteBidGUID) {
    var data = {
      action: 'GetInviteBid',
      InviteBidGUID: inviteBidGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  HandleBM (providerGUID, cgPlanGUID) {
    var data = {
      action: 'HandleBM',
      ProviderGUID: providerGUID,
      CgPlanGUID: cgPlanGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  HandleRW (providerGUID, cgPlanGUID) {
    var data = {
      action: 'HandleRW',
      ProviderGUID: providerGUID,
      CgPlanGUID: cgPlanGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  handleFB (providerGUID, cgPlanGUID) {
    var data = {
      action: 'HandleFB',
      ProviderGUID: providerGUID,
      CgPlanGUID: cgPlanGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  handleBSXZ (providerGUID, cgPlanGUID) {
    var data = {
      action: 'HandleBSXZ',
      ProviderGUID: providerGUID,
      CgPlanGUID: cgPlanGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  handleHB (providerGUID, cgPlanGUID) {
    var data = {
      action: 'HandleHB',
      ProviderGUID: providerGUID,
      CgPlanGUID: cgPlanGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  handleDB (providerGUID, cgPlanGUID) {
    var data = {
      action: 'HandleDB',
      ProviderGUID: providerGUID,
      CgPlanGUID: cgPlanGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  handleQY (providerGUID, cgPlanGUID) {
    var data = {
      action: 'HandleQY',
      ProviderGUID: providerGUID,
      CgPlanGUID: cgPlanGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  GetInviteBidForenotice (inviteBidForenoticeGUID) {
    var data = {
      action: 'GetInviteBidForenotice',
      InviteBidForenoticeGUID: inviteBidForenoticeGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  }
}

export default MyInviteBidService
